<template>
	<div>
		<view class="topTab">


			<van-tabs bind:change="onChange">
				<van-tab title="话题" class="talk">
					<plusTalk :userOpenid="userOpenid"></plusTalk>
				</van-tab>


				<van-tab title="闲置" class="freetake">
					<plusFreeTake :userOpenid="userOpenid"></plusFreeTake>
				</van-tab>


				<van-tab title="跑腿" clas="run">
					<plus-run :userOpenid="userOpenid"></plus-run>
				</van-tab>



				<van-tab title="租赁" class="rent">
					<plusRent :userOpenid="userOpenid"></plusRent>
				</van-tab>


			</van-tabs>
		</view>
	</div>
</template>

<script>
	import plusTake from '@/components/plusTalk/plusTalk.vue'
	import plusFreeTake from '@/components/plusFreeTake/plusFreeTake.vue'
	import plusRun from '@/components/plusRun/plusRun.vue'
	import plusRent from '@/components/plusRent/plusRent.vue'



	//这里留意一下

	export default {
		name: 'home',
		components: {
			plusTake,
			plusFreeTake,
			plusRun,
			plusRent
		},
		data() {
			return {
				title: ['话题', '闲置', '跑腿', '租赁'],
				userOpenid: ''
			}
		},
		onLoad() {
			try {
				const value = uni.getStorageSync('userInfo');
				if (value) {
					this.userOpenid = value.openId;
					console.log(this.userOpenid);
				}
			} catch (e) {
				// error
			}
		},
		onChange(event) {
			wx.showToast({
				title: `切换到标签 ${event.detail.name}`,
				icon: 'none',
			});
		},
	}
</script>

<style scoped>
	page {
		min-height: 100vh;
	}

	/* 底部的紫色 */
	div {
		overflow: inherit;
		min-height: 90vh;
		background-color: #5B53C9;
	}

	.topTab {}

	.container {
		min-height: 100vh;
		overflow: hidden;
	}
</style>
